#pragma once
#include "SpriteBatchNode.h"
#include "SpriteNode.h"
#include <string>
#include "Node.h"
#include "..\content\ResManager.h"

namespace ds {

class DynamicSpriteNode : public Node {

public:
	DynamicSpriteNode(const std::string& name,const std::string& materialName,SpriteColorMode mode = SCM_MODULATE,SpriteBlendMode sbm = SBM_NORMAL);
	virtual ~DynamicSpriteNode(void);
	void onCreateDevice();
	void onDestroyDevice();		
	void prepareRendering();
	void postRendering();
	void draw();
	void addSprite(Sprite* sprite);
	void init() {}
	void loadContent(ResManager& resourceManager) {}
private:
	// members
	LPD3DXSPRITE pSprite;	
	int m_Counter;
	Material* m_Material;
	Vec2* m_Positions;
	RECT* m_Offsets;
	Color* m_Colors;
	float* m_Rotations;
	Vec2* m_Scales;
	Vec2* m_Centers;
	Matrix* m_Matrix;	
	SpriteColorMode m_ColorMode;
	SpriteBlendMode m_BlendMode;
};

}

